﻿Public Class ThanhTichDAO
    Public Shared Function SelectAll() As DataTable
        Dim strSQL As String = "select * from THANHTICH"
        Dim dt As DataTable
        dt = Provider.ExecQuery(strSQL)
        Return dt
    End Function

    Public Shared Sub Insert(ByVal _tt As ThanhTichDTO)
        Dim strSQL As String = "Insert into THANHTICH(TenThanhTich)  Values('" & _tt.TenThanhTich & "')"
        Provider.ExecNoneQuery(strSQL)
    End Sub

    Public Shared Sub Delete(ByVal _tt As ThanhTichDTO)
        Dim strSQL As String = "delete from THANHTICH where MaThanhTich = " & _tt.MaThanhTich
        Provider.ExecNoneQuery(strSQL)
    End Sub

    Public Shared Sub Update(ByVal _tt As ThanhTichDTO)
        Dim strSQL As String = "Update THANHTICH set TenThanhTich = '" & _tt.TenThanhTich & "' Where MaThanhTich = " & _tt.MaThanhTich
        Provider.ExecNoneQuery(strSQL)
    End Sub
End Class
